<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
	xmlns:bmb="http://bmb.org"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />

<xsl:template match="/bmb:history">
	<html>
    <head>
		<style type="text/css">
			body {
        		width: 960px;
       			margin: auto;
       		}
       		div, h1, h2, h3 {
       			text-align: center;
       		}
       		.selectedAnswer {
  				color: red;
			}
			.normalAnswer {
  					color: black;
  			}
       	</style>
	</head>
	<body>
        <h1><xsl:value-of select="bmb:formName" /></h1>
        <h2><xsl:value-of select="bmb:dateStart" /></h2>
        <xsl:template match="bmb:questions">
        	<xsl:for-each select="bmb:questions/bmb:question">
        		<div>
        			<h3><xsl:value-of select="bmb:content" /></h3>
        			<table align="center">
                 	<xsl:for-each select="bmb:answers/bmb:answer">
                 		<tr>
                 			<xsl:choose>
          						<xsl:when test="bmb:selected='true' ">
          							<td class="selectedAnswer">
              						 	<xsl:value-of select="bmb:content" />
              						</td>
           						</xsl:when>
           						<xsl:otherwise>
               						<td class="normalAnswer">
              					 		<xsl:value-of select="bmb:content" />
              						</td>
           						</xsl:otherwise>
        					</xsl:choose>          
                 		</tr>
        			</xsl:for-each>
                 	</table>
                </div>
            </xsl:for-each>
        </xsl:template>
	</body>
    </html>
</xsl:template>

</xsl:stylesheet>